<template>
  <div class="app-container">
    <!-- 申请表 -->
    <div class="form-blok" v-loading="nextLoading" element-loading-text="正在加载下一个...">
      <div class="source" id="table">
        <!-- 标题 -->
        <h1 >
            <span  v-if=" formData.applyYear">{{"（" + formData.applyYear+"）"}}</span>广西水利电力职业技术学院家庭经济困难学生认定申请表
          </h1>

        <!-- 基础信息 -->
        <el-form  :model="formData" ref="formData" label-width="0px" size="mini" :disabled="this.action == 3">
          <table class="full-width">
            <!--学号姓名性别-->
            <tr>
              <!-- <td class="table-label rl" rowspan="10">学生基本情况</td> -->
                <td class="table-label"><span class="red-tip">*</span>学号</td>
                <td class="table-input" style="width:240px;" >
                    <el-form-item prop="xh" :rules="rules">
                    	<el-input @blur="inputHandler" :disabled="this.formData.step >2" v-model="formData.xh" placeholder="请输入学号"></el-input>
                    </el-form-item>
                </td>
                <td class="table-label" ><span class="red-tip">*</span>姓名</td>
                <td class="table-input" style="width:240px;">
					<el-form-item prop="xm"  :rules="rules">
						<el-input :disabled="this.formData.step >2" v-model="formData.xm" placeholder="请输入姓名"></el-input>
					</el-form-item>
                </td>
              
                <td class="table-label" > <span class="red-tip">*</span>性别</td>
                <td class="table-input" style="width:240px">
                    <el-form-item prop="xb" :rules="rules">
                    	<el-input :disabled="this.formData.step >2" v-model="formData.xb" placeholder="请输入性别"></el-input>
                    </el-form-item>
                </td>

              <!-- <td class="table-label"><span class="red-tip">*</span>出生年月</td>
              <td class="table-input" style="width:100px" >
                <el-form-item prop="csny" :rules="rules">
                  <el-date-picker :disabled="this.formData.step >2" value-format="yyyy-MM" format="yyyy-MM"
                    v-model="formData.csny"  type="date" placeholder="选择日期">
                  </el-date-picker>
                </el-form-item>
              </td> -->
            </tr>
            <!-- 学院年级班级 -->
            <tr>
             
              <td class="table-label" ><span class="red-tip">*</span>学院</td>
              <td class="table-input">
                <el-form-item prop="xm"  :rules="rules">
                  <el-input :disabled="this.formData.step >2" v-model="formData.xy" placeholder="请输入姓名"></el-input>
                </el-form-item>
              </td>
              
              <td class="table-label" > <span class="red-tip">*</span>年级</td>
              <td class="table-input">
                <el-form-item prop="nj" :rules="rules">
                  <el-input :disabled="this.formData.step >2" v-model="formData.nj" placeholder="请输入年级"></el-input>
                </el-form-item>
              </td>

              <td class="table-label"><span class="red-tip">*</span>班级</td>
              <td class="table-input">
                <el-form-item prop="bj" :rules="rules">
                   <el-input :disabled="this.formData.step >2" v-model="formData.bj" placeholder="请输入性别"></el-input>
                </el-form-item>
              </td>
            </tr>
            <!-- 身份证民族手机号 -->
            <tr>
                <td class="table-label" style="width: 80px;min-width: 80px;"><span class="red-tip">*</span>身份证号</td>
                <td class="table-input" >
                    <el-form-item prop="sfzhm" :rules="rules">
                    <el-input :disabled="this.formData.step >2" v-model="formData.sfzhm" placeholder="请输入身份证"></el-input>
                    </el-form-item>
                </td>

                <td class="table-label"><span class="red-tip">*</span>民族</td>
                <td class="table-input" style="width: 80px;min-width: 80px;">
                    <el-form-item prop="mz" :rules="rules">
                        <!--                  <el-input :disabled="this.formData.step >2" v-model="formData.mz" placeholder="请输入民族"></el-input>-->
                        <el-select :disabled="this.formData.step >2" v-model="formData.mz" filterable placeholder="请输入民族">
                            <el-option v-for="item in nation" :key="item" :label="item" :value="item">
                            </el-option>
                        </el-select>
                    </el-form-item>
                </td>
              <td class="table-label"><span class="red-tip">*</span>手机号</td>
              <td class="table-input" >
                <el-form-item prop="phone" :rules="rules">
                  <el-input @blur="inputHandler" :disabled="this.formData.step >2" v-model="formData.phone"
                    placeholder="请输入学号"></el-input>
                </el-form-item>
              </td>
            </tr>
            <!-- 家庭人口数、在学人数、赡养人数 -->
            <tr>
              <!-- <td class="table-label" rowspan="4" style="width: 80px;min-width: 80px;">家庭情况</td> -->
              <td class="table-label" style="border-left:1px solid #000;">
                <span class="red-tip">*</span>家庭人口数
              </td>
              <td class="table-input " >
                <el-form-item prop="rkzs" :rules="rules">
                  <el-input  onkeyup="value=value.replace(/[^\d]+/g,'')" :disabled="this.formData.step >2" v-model="formData.rkzs" placeholder="请输入家庭人口数"></el-input>
                </el-form-item>
              </td>
              <td class="table-label">
                <span class="red-tip">*</span>家庭成员在学人数
              </td>
              <td class="table-input" >
                <el-form-item prop="jtcyzxrs" :rules="rules">
                  <el-input onkeyup="value=value.replace(/[^\d]+/g,'')" :disabled="this.formData.step >2" v-model="formData.jtcyzxrs"
                    placeholder="请输入在学人数"></el-input>
                </el-form-item>
              </td>
              <td class="table-label">
                <span class="red-tip">*</span>赡养人数
              </td>
              <td class="table-input">
                <el-form-item prop="syrs" :rules="rules">
                  <el-input onkeyup="value=value.replace(/[^\d]+/g,'')" :disabled="this.formData.step >2" v-model="formData.syrs" placeholder="请输入赡养人数"></el-input>
                </el-form-item>
              </td>
            </tr>
            <tr>
                <td class="table-label">
                    <span class="red-tip">*</span>家庭成员失业人数
                </td>
                <td class="table-input" >
                    <el-form-item prop="jtcysyrs" :rules="rules">
                        <el-input onkeyup="value=value.replace(/[^\d]+/g,'')" :disabled="this.formData.step >2" v-model="formData.jtcysyrs"
                        placeholder="请输入失业人数"></el-input>
                    </el-form-item>
                </td>
                <td class="table-label">
                    <span class="red-tip">*</span>全国学生资助系统、广西学生精准系统困难标签
                </td>
                 <td class="table-input" colspan="3" >

					<el-form-item prop="knlx" :rules="rules">
                        <el-input  :disabled="this.formData.step < 2" v-model="formData.knlx"
                        placeholder="困难类型"></el-input>
                    </el-form-item>
                
                 </td>
            </tr>
            <!-- 家庭信息 -->
            <tr>
              <td colspan="6" class="table-label">家庭基本信息</td>
            </tr>
            <!-- 籍贯和户籍所在地 -->
            <tr>
              <td class="table-label"><span class="red-tip">*</span>籍贯</td>
              <td class="table-input table-align-left">
                <el-form-item prop="jg" :rules="rules">
                    <el-input  :disabled="this.formData.step >2" v-model="formData.jg"
                    placeholder="籍贯"></el-input>
                </el-form-item>
              </td>
              <td class="table-label"><span class="red-tip">*</span>户籍所在地</td>
              <td class="table-input" colspan="3">
                <el-form-item prop="hjszd" style="max-height: 80px;" :rules="rules">
                  <el-input type="textarea" :rows="1" placeholder=" 省(区)/市/县" v-model="formData.hjszd"
                    :disabled="formData.step >2">
                  </el-input>
                </el-form-item>
              </td>
            </tr>
            <!-- <tr>
              <td class="table-label"><span class="red-tip">*</span>户籍性质</td>
              <td class="table-input table-align-left">
                <el-form-item prop="hjxz" :rules="selerules">
                  <el-radio-group v-model="formData.hjxz">
                    <el-radio :label="'城镇'" :disabled="formData.step >2">城镇</el-radio>
                    <el-radio :label="'农村'" :disabled="formData.step >2">农村</el-radio>
                  </el-radio-group>
                </el-form-item>
              </td>
              <td class="table-label"><span class="red-tip">*</span>户籍所在地</td>
              <td class="table-input" colspan="4">
                <el-form-item prop="hjszd" style="max-height: 80px;" :rules="rules">
                  <el-input type="textarea" :rows="2" placeholder=" 省(区)/市/县" v-model="formData.hjszd"
                    :disabled="formData.step >2">
                  </el-input>
                </el-form-item>
              </td>
            </tr> -->
            <!-- <tr>
              <td class="table-label"><span class="red-tip">*</span>家长姓名</td>
              <td class="table-input" colspan="2">
                <el-form-item prop="jzdh" :rules="rules">
                  <el-input v-model="formData.jzdh" placeholder="家长姓名" :disabled="formData.step >2"></el-input>
                </el-form-item>
              </td>
              <td class="table-label"><span class="red-tip">*</span>联系电话</td>
              <td class="table-input" colspan="2">
                <el-form-item prop="parentstel">
                  <el-input v-model="formData.parentstel" placeholder="联系电话" type="number"
                    :disabled="formData.step >2"></el-input>
                </el-form-item>
              </td>
            </tr> -->
            <tr>
              <td class="table-label"><span class="red-tip">*</span>家庭居住房产（住房）情况</td>
              <td class="table-input table-align-left">
                <el-form-item prop="jtjzfqk" :rules="selerules">
                  <el-radio-group v-model="formData.jtjzfqk">
                    <el-radio :label="'商品房'" :disabled="formData.step >2">商品房</el-radio>
                    <el-radio :label="'单位福利住房'" :disabled="formData.step >2">单位福利住房</el-radio>
                    <el-radio :label="'自建房'" :disabled="formData.step >2">自建房</el-radio>
                    <el-radio :label="'租房、无房'" :disabled="formData.step >2">租房、无房</el-radio>
                    <el-radio :label="'其他'" :disabled="formData.step >2">其他</el-radio>
                  </el-radio-group>
                </el-form-item>
              </td>
              <td class="table-label"><span class="red-tip">*</span>家中有汽车情况</td>
              <td class="table-input table-align-left" >
                <el-form-item prop="jtqcqk" :rules="selerules">
                  <el-radio-group v-model="formData.jtqcqk">
                    <el-radio :label="'自用'" :disabled="formData.step >2">自用</el-radio>
                    <el-radio :label="'经营用'" :disabled="formData.step >2">经营用</el-radio>
                    <el-radio :label="'无汽车'" :disabled="formData.step >2">无汽车</el-radio>
                  </el-radio-group>
                </el-form-item>
              </td>

              <td class="table-label"><span class="red-tip">*</span>家长手机号码</td>
              <td class="table-input" colspan="2">
                <el-form-item prop="parentstel">
                  <el-input v-model="formData.parentstel" placeholder="联系电话" type="number" :disabled="formData.step >2"></el-input>
                </el-form-item>
              </td>
            </tr>

            <tr>
              <td class="table-label"><span class="red-tip">*</span>家庭居住现居住地址</td>
              <td class="table-input" colspan="5">
                <div>
                  <el-form-item prop="jtxjzdz" :rules="rules">
                    <el-input :disabled="formData.step >2" placeholder="省（自治区）/市/县（市、区）/镇（街道）/村（居委）/（门牌号）"
                      v-model="formData.jtxjzdz">
                    </el-input>
                  </el-form-item>
                </div>
              </td>
            </tr>



            <!-- 家庭成员情况 -->
     
            <tr>
              <td colspan="6"   class="table-label">家庭成员情况</td>
            </tr>
            <tr>
              <td style="padding:0px;" colspan="6">
                <el-table :data="formData.jtcyObj" border style="width:100%"  :row-class-name="handelIndex">
                  <el-table-column prop="xm" label="姓名" align="center">

                  </el-table-column>
                  <el-table-column prop="nl" label="年龄"  align="center">

                  </el-table-column>
                  <el-table-column prop="gx" label="与学生关系"  align="center">

                  </el-table-column>
                  <el-table-column prop="dw" label="工作（学习）单位"  align="center">

                  </el-table-column>
                  <el-table-column prop="tel" label="联系电话"  align="center">

                  </el-table-column>

                  <el-table-column prop="zy" label="职业" align="center">

                  </el-table-column>
                  <el-table-column prop="nsr" label="年收入（元）"  align="center">

                  </el-table-column>
                  <el-table-column prop="jkzk" label="健康状况"  align="center">

                  </el-table-column>
                  <!--  <el-table-column label="操作" align="center" v-if="formData.step==1 || this.formData.step == 0">
                    <template slot-scope="data">
                      <el-button type="text" @click="handelDel(data.row)">删除</el-button>
                    </template>
                  </el-table-column> -->
                </el-table>
                <div style="padding: 5px;" v-if="formData.step==1 || formData.step == 0 || formData.step == 2">
                  <!-- 注意：该部分内容编辑请到个人信息家庭成员处修改<div style="color: blue;" @click="goEditInfo">点击跳转</div> -->
                  <el-button id="editFamily" @click="dialogTableVisible = true" type="text">编辑家庭成员</el-button>
                </div>
              </td>
            </tr>

            <!-- 收入 -->
            <tr>
                <td class="table-label"><span class="red-tip">*</span>家庭总收入（元）</td>
                <td >
                    <div style="display: flex;align-items: center;">

                        <el-form-item prop="jtnsr">
                            <el-input type="number" v-model="income" placeholder="自动计算家庭年收入" disabled />
                        </el-form-item>
                        元
                    </div>
                </td>
                <td class="table-label"><span class="red-tip">*</span>家庭人均年收入（元）</td>
                <td colspan="3">
                    <div style="display: flex;align-items: center;">
                        <el-form-item prop="rjnsr">
                            <el-input type="number" v-model="capita" placeholder="自动计算人均年收入" disabled />
                        </el-form-item>
                        元
                    </div>
                </td>
            </tr>



   
            <!-- 影响家庭经济状况信息 -->
			<tr>
				<td class="table-label"><span class="red-tip">*</span>家庭经济主要收入来源</td>
				<td class="table-input">
					<el-form-item prop="jtzysr" :rules="selerules">
						<el-checkbox-group v-model="formData.jtzysr"  :disabled="formData.step >2">
							<el-checkbox :label="'机关事业单位公职人员'"></el-checkbox>
							<el-checkbox :label="'单位公司合同制职工'"></el-checkbox>
							<el-checkbox :label="'私营业主'"></el-checkbox>
							<el-checkbox :label="'个体工商户'"></el-checkbox>
							<el-checkbox :label="'务工'"></el-checkbox>
							<el-checkbox :label="'务农'"></el-checkbox>
							<el-checkbox :label="'无固定收入'"></el-checkbox>
							<el-checkbox :label="'无收入'"></el-checkbox>
							<el-checkbox :label="'其他'"></el-checkbox>
						</el-checkbox-group>
					</el-form-item>
					<!-- {{formData.jtzysr}} -->
				</td>
				<td class="table-label">其他收入说明</td>
				<td class="table-input" colspan="3">
					<el-form-item prop="jtzysr2" >
						<el-input v-model="formData.jtzysr2" :disabled="formData.step >2"
						placeholder="请其他收入（简要说明）"></el-input>
					</el-form-item>
					
				</td>
			</tr>
			<tr>
				<td class="table-label"><span class="red-tip">*</span>学生父母丧失劳动能力或劳动能力弱（单位：人）</td>
				<td class="table-input">
          	<el-form-item prop="ssldnl" :rules="rules">
              <el-input onkeyup="value=value.replace(/[^\d]+/g,'')" v-model="formData.ssldnl" :disabled="formData.step >2" 
                          placeholder="请输入">
              </el-input>
            </el-form-item>
				
				</td>
				<td class="table-label"><span class="red-tip">*</span>需赡养丧失劳动能力的共同生活家庭成员（单位：人）</td>
				<td class="table-input" >
          	<el-form-item prop="zyssldnl" :rules="rules">
					    <el-input  onkeyup="value=value.replace(/[^\d]+/g,'')" :disabled="formData.step >2" v-model="formData.zyssldnl" placeholder="请输入"></el-input>
            </el-form-item>
				</td>

				<td class="table-label"><span class="red-tip">*</span>患病残疾人（单位：人）</td>
				<td class="table-input" >
           	<el-form-item prop="hbcjr" :rules="rules">
					    <el-input  onkeyup="value=value.replace(/[^\d]+/g,'')" :disabled="formData.step >2" v-model="formData.hbcjr" placeholder="请输入">
						</el-input>
            </el-form-item>
				</td>
			</tr>
			<!-- 突发事件 -->
			<tr>
				<td class="table-label"><span class="red-tip">*</span>突发事件</td>
				<td class="table-input" colspan="3">
          <el-form-item  :rules="selerules" prop="tfsj">
            <el-checkbox-group v-model="formData.tfsj"  :disabled="formData.step >2">
              <el-checkbox :label="'家庭遭受疫情'"></el-checkbox>
              <el-checkbox :label="'家庭遭受自然灾害'"></el-checkbox>
              <el-checkbox :label="'家庭遭受突发意外事件'"></el-checkbox>
              <el-checkbox :label="'家庭欠债'"></el-checkbox>
              <el-checkbox :label="'其它情况'"></el-checkbox>
              <el-checkbox :label="'无'"></el-checkbox>
            </el-checkbox-group>
          </el-form-item>
				</td>
				<td class="table-label">其他情况</td>
				<td class="table-input" >
					 <el-input :disabled="formData.step >2" v-model="formData.tfsj3"
                                placeholder="请填写其他情况"></el-input>
				</td>

				<!-- <td class="table-label">具体时间、内容及涉及金额等情况</td>
				<td class="table-input" >
					{{formData.tfsj2}}
				</td> -->
			</tr>
			<tr>
				<td class="table-label"><span class="red-tip">*</span>具体时间、内容及涉及金额等情况</td>
				<td class="table-input" colspan="5">
          <el-form-item   prop="tfsj2" :rules="rules">
					  <el-input type="textarea"  :autosize="{ minRows: 6, maxRows: 18}" :disabled="formData.step >2" v-model="formData.tfsj2"
                                placeholder="具体时间、内容及涉及金额等情况"></el-input>
          </el-form-item>
				</td>
			</tr>
            
            <!-- 申请理由 -->
            <tr>
              <td class="table-label rl"><span class="red-tip">*</span>申请理由</td>
                <td style="text-align: left;" colspan="5">
                    <el-form-item prop="sqly" :rules="textAreaRules" >
                        <el-input 
                           show-word-limit
                            :disabled="formData.step >2"
                            placeholder="请输入内容" 
                            type="textarea" 
                            maxlength="200"
                            minlength="100"
                            v-model="formData.sqly"
                            :autosize="{ minRows: 6, maxRows: 18}"
                        ></el-input>
                    </el-form-item>
                </td>
            </tr>
            <!-- 承诺书 -->
            
            <tr>
              <td class="table-label rl">个人承诺</td>
              <td style="text-align: left;" colspan="5">
                	<div style="margin: 10px 10px;">本人承诺以上所填资料真实、准确，并同意授权相关部门通过信息核对，对所填资料进行查询、核对。如虚报资料，本人愿意承担相关责任。</div>
					<el-row class="radio-group-row">
						<div class="radio-group">
               <el-form-item prop="sqrcn" :rules="selerules" >
                  <el-radio-group v-model="formData.sqrcn">
                    <el-radio :label="'1'" :disabled="formData.step >1 ">同意</el-radio>
                  </el-radio-group>
                  <el-radio-group v-model="formData.sqrcn">
                    <el-radio :label="'0'" :disabled="formData.step >1 ">不同意</el-radio>
                  </el-radio-group>
               </el-form-item>
						</div>
                    </el-row>
					<div style="display: flex; justify-content: flex-end;margin-right: 100px;">
						<span><span class="red-tip">*</span> 手写签字：</span>
						<span>
							<!-- <el-upload :disabled="formData.step >1" class="avatar-uploader" :action="upload.url"
							:headers="upload.headers" :show-file-list="false" :on-success="handleSignatureSuccess">
							<img v-if="formData.sqrqm" :src="baseurl+formData.sqrqm" class="signature-img">
							<span class="signature-tip" v-else>签名</span>
							</el-upload> -->
              <signature :url="formData.sqrqm" @save-success="saveSuccessHandle"></signature>
						</span>
					</div>

                <div style="text-align: right;">{{formData.sqrqmrq}}</div>
              </td>
            </tr>
          <!-- 班级评议意见 -->
            <tr>
                <td class="table-label rl">辅导员意见</td>
                <td style="text-align: left;" colspan="5">
                    <div style="margin: 10px 10px;"><span class="red-tip">*</span> 经班级评议小组民主评议，认为该生（□符合 □不符合）家庭经济困难学生认定条件，推荐认定困难类型为：</div>
                    <el-row class="radio-group-row">
						<div class="radio-group">
							<el-radio-group v-model="formData.bjpyyj">
							<el-radio :label="'1'" :disabled="formData.step!=2 || this.state==1">特别困难</el-radio>
							</el-radio-group>
							<el-radio-group v-model="formData.bjpyyj">
							<el-radio :label="'2'" :disabled="formData.step!=2 || this.state==1">比较困难</el-radio>
							</el-radio-group>
							<el-radio-group v-model="formData.bjpyyj">
							<el-radio :label="'3'" :disabled="formData.step!=2 || this.state==1">一般困难</el-radio>
							</el-radio-group>
							<el-radio-group v-model="formData.bjpyyj">
							<el-radio :label="'4'" :disabled="formData.step!=2 || this.state==1">不困难</el-radio>
							</el-radio-group>
						</div>
                    </el-row>
                    <div style="display: flex; justify-content: flex-end;margin-right: 100px;margin-top: 5px;">
                    <span> <span class="red-tip">*</span> 辅导员签字：</span>
                    <span>
                        <el-upload :disabled="this.formData.step != 2 || this.state==1" class="avatar-uploader"
                        :action="upload.url" :headers="upload.headers" :show-file-list="false"
                        :on-success="handleFdySignatureSuccess">
                          <img v-if="formData.fdyqm" :src="baseurl+formData.fdyqm" class="signature-img">
                          <span class="signature-tip" v-else>签名</span>
                        </el-upload>
                    </span>
                    </div>
                    <div style="text-align: right;">{{formData.fdyqmrq}}</div>
                </td>
            </tr>
          <!-- 二级学院认定意见 -->
            <tr>
                <td class="table-label rl" >二级学院认定意见</td>
                <td style="text-align: left;" colspan="5">
                    <div style="margin: 10px 10px;"><span class="red-tip">*</span> 经学院认定工作组审查，认为该生（□符合 □不符合）家庭经济困难学生认定条件；认定困难类型为：</div>
                    <el-row class="radio-group-row">
                    <div class="radio-group">
                        <el-radio-group v-model="formData.ejxyldqmyj">
                        <el-radio :label="'1'" :disabled="formData.step!=3 || this.state==1">特别困难</el-radio>
                        </el-radio-group>
                        <el-radio-group v-model="formData.ejxyldqmyj">
                        <el-radio :label="'2'" :disabled="formData.step!=3 || this.state==1">比较困难</el-radio>
                        </el-radio-group>
                        <el-radio-group v-model="formData.ejxyldqmyj">
                        <el-radio :label="'3'" :disabled="formData.step!=3 || this.state==1">一般困难</el-radio>
                        </el-radio-group>
                        <el-radio-group v-model="formData.ejxyldqmyj">
                        <el-radio :label="'4'" :disabled="formData.step!=3 || this.state==1">不困难</el-radio>
                        </el-radio-group>
                    </div>
                    </el-row>
                    <div style="display: flex; justify-content: flex-end;margin-right: 100px;margin-top: 5px;">
                    <span><span class="red-tip">*</span>  二级学院负责人签字：</span>
                    <span>
                        <el-upload :disabled="this.formData.step != 3 || this.state==1" class="avatar-uploader"
                        :action="upload.url" :headers="upload.headers" :show-file-list="false"
                        :on-success="handleEjxyldSignatureSuccess">
                        <img v-if="formData.ejxyldqm" :src="baseurl+formData.ejxyldqm" class="signature-img">
                        <span class="signature-tip" v-else>签名</span>
                        </el-upload>
                    </span>
                    </div>
                    <div style="text-align: right;"> {{formData.ejxyldqmrq}}</div>
                    <div style="text-align: right;">（加盖二级学院公章）</div>
                </td>
            </tr>
 
          <!-- 学校审核意见 -->

    
            <tr>
              <td style="writing-mode:vertical-rl; " class="table-label">学校审核意见</td>
        
                <td style="text-align: left;" colspan="5">
                <div style="margin: 10px 10px;"><span class="red-tip">*</span> 经学校学生资助工作领导小组审查，经5个工作日公示无异议，认定该生（□符合 □不符合）家庭经济困难学生认定条件，同意认定困难类型为：</div>
                <el-row class="radio-group-row">
                    <div class="radio-group">
                    <el-radio-group v-model="formData.xsqmyj">
                        <el-radio :label="'1'" :disabled="formData.step!=4 || this.state==1">特别困难</el-radio>
                    </el-radio-group>
                    <el-radio-group v-model="formData.xsqmyj">
                        <el-radio :label="'2'" :disabled="formData.step!=4 || this.state==1">比较困难</el-radio>
                    </el-radio-group>
                    <el-radio-group v-model="formData.xsqmyj">
                        <el-radio :label="'3'" :disabled="formData.step!=4 || this.state==1">一般困难</el-radio>
                    </el-radio-group>
                    <el-radio-group v-model="formData.xsqmyj">
                        <el-radio :label="'4'" :disabled="formData.step!=4 || this.state==1">不困难</el-radio>
                    </el-radio-group>
                    </div>
                </el-row>
                <div style="display: flex; justify-content: flex-end;margin-right: 100px;margin-top: 5px;">
                    <span> <span class="red-tip">*</span> 学校负责人签字：</span>
                    <span>
                    <el-upload :disabled="this.formData.step != 4 || this.state==1" class="avatar-uploader"
                        :action="upload.url" :headers="upload.headers" :show-file-list="false"
                        :on-success="handleXuexiaoSignatureSuccess">
                        <img v-if="formData.xsqm" :src="baseurl+formData.xsqm" class="signature-img">
                        <span class="signature-tip" v-else>签名</span>
                    </el-upload>
                    </span>
                </div>
                <div style="text-align: right;"> {{formData.xsqmrq}}</div>
                <div style="text-align: right;">（加盖学校公章）</div>
                </td>
            </tr>
      

        
            <tr>
              <td style="writing-mode:vertical-rl; " class="table-label">困难佐证材料</td>
              <td class="" colspan="5" style="min-width: 500px;">
                <Affix :notupload="formData.step>2" :accpet="accpet"  @input="handleAffix" v-model="formData.affixId" :maxSize="0.5">
                </Affix>
              </td>
            </tr>
          </table>

        </el-form>

      </div>


      <!-- 打印 -->
      <el-dialog
        class="dialog"

        :visible.sync="open"
        fullscreen
        :close-on-click-modal="false"
        append-to-body
      >
        <div  class="source" style="width:1000px" id="print" v-loading="printLoading">
          <!-- 标题 -->
          <h1>广西水利电力职业技术学院</h1>
        <h1 style="margin-top:0px">{{'(' + formData.applyYear +')家庭经济困难学生认定申请表'}}</h1>
          <!-- 基础信息 -->
          <el-form :model="formData" ref="formData" label-width="0px" size="mini">
            <table class="full-width">
              <!--学号姓名性别-->
              <tr>
                <!-- <td class="table-label rl" rowspan="10">学生基本情况</td> -->
                  <td class="table-label">学号</td>
                  <td class="table-input" style="width:240px;" >
                    {{formData.xh}}
                  </td>
                  <td class="table-label" >姓名</td>
                  <td class="table-input" style="width:240px;">
            {{formData.xm}}
                  </td>
                
                  <td class="table-label" > 性别</td>
                  <td class="table-input" style="width:240px">
            {{formData.xb}}
                  </td>
              </tr>
              <!-- 学院年级班级 -->
              <tr>
              
          <td class="table-label" >学院</td>
          <td class="table-input">
            {{formData.xy}}
          </td>
                
          <td class="table-label" > 年级</td>
          <td class="table-input">
            {{formData.nj}}
          </td>

          <td class="table-label">班级</td>
          <td class="table-input">
            {{formData.bj}}
          </td>
              </tr>
              <!-- 身份证民族手机号 -->
              <tr>
                  <td class="table-label" style="width: 80px;min-width: 80px;">身份证号</td>
                  <td class="table-input" >
            {{formData.sfzhm}}
                  </td>

                  <td class="table-label">民族</td>
                  <td class="table-input" style="width: 80px;min-width: 80px;">
                      <el-form-item prop="mz" :rules="rules">
                      
                          {{formData.mz}}
                      </el-form-item>
                  </td>
          <td class="table-label">手机号</td>
          <td class="table-input" >
            <el-form-item prop="xh" :rules="rules">
              {{formData.phone}}
            </el-form-item>
          </td>
              </tr>
              <!-- 家庭人口数、在学人数、赡养人数 -->
              <tr>
              
          <td class="table-label" style="border-left:1px solid #000;">
            家庭人口数
          </td>
          <td class="table-input " >
            {{formData.rkzs}}
          </td>
          <td class="table-label">
            家庭成员在学人数
          </td>
          <td class="table-input" >
            {{formData.jtcyzxrs}}
          </td>
          <td class="table-label">
            赡养人数
          </td>
          <td class="table-input">
            {{formData.syrs}}
          </td>
              </tr>
        <!-- 失业人数 -->
              <tr>
                  <td class="table-label">
                    家庭成员失业人数
                  </td>
                  <td class="table-input" >
                      {{formData.jtcysyrs}}
                  </td>
                  <td class="table-label">
                    全国，广西学生精准系统匹配后的困难类别数据
                  </td>
                  <td class="table-input" colspan="3" >
            {{formData.knlx}}
                  </td>
              </tr>
              <!-- 家庭信息 -->
              <tr>
                <td colspan="6" class="table-label">家庭基本信息</td>
              </tr>
              <!-- 籍贯和户籍所在地 -->
              <tr>
          <td class="table-label">籍贯</td>
          <td class="table-input ">
            {{formData.jg}}
          </td>
                  <td class="table-label">户籍所在地</td>
          <td class="table-input" colspan="3">
            {{formData.hjszd}}
          </td>
              </tr>
              <!-- 居住情况和汽车情况 家长电话号码-->
              <tr>
                <td class="table-label">家庭居住房产（住房）情况</td>
                <td class="table-input ">
                  {{formData.jtjzfqk}}
                </td>
                <td class="table-label">家中有汽车情况</td>
                <td class="table-input table-align-left" >
                  {{formData.jtqcqk}}
                </td>

                <td class="table-label">家长手机号码</td>
                <td class="table-input" colspan="2">
          {{formData.parentstel}}
                </td>
              </tr>
        <!-- 现居住地址 -->
              <tr>
                <td class="table-label">家庭居住现居住地址</td>
                <td class="table-input" colspan="5">
                  {{formData.jtxjzdz}}
                </td>
              </tr>



              <!-- 家庭成员情况 -->
              <tr>
                <td colspan="6"   class="table-label">家庭成员情况</td>
              </tr>
              <tr>
                <td style="padding:0px;" colspan="6">
                  <el-table :data="formData.jtcyObj" border style="width:100%"  :row-class-name="handelIndex" fit="true">
                    <el-table-column prop="xm" label="姓名" align="center">

                    </el-table-column>
                    <el-table-column prop="nl" label="年龄"  align="center" >

                    </el-table-column>
                    <el-table-column prop="gx" label="与学生关系"  align="center" >

                    </el-table-column>
                    <el-table-column prop="dw" label="工作（学习）单位"  align="center" min-width="200">

                    </el-table-column>
                    <el-table-column prop="tel" label="联系电话"  align="center" min-width="85">

                    </el-table-column>

                    <el-table-column prop="zy" label="职业" align="center">

                    </el-table-column>
                    <el-table-column prop="nsr" label="年收入（元）"  align="center">

                    </el-table-column>
                    <el-table-column prop="jkzk" label="健康状况"  align="center">

                    </el-table-column>
        
                  </el-table>
                
                </td>
              </tr>

              <!-- 收入 -->
              <tr>
                  <td class="table-label"><span class="red-tip">*</span>家庭总收入（元）</td>
                  <td >
                      <div style="display: flex;align-items: center;">
                          {{income}}
                          元
                      </div>
                  </td>
                  <td class="table-label"><span class="red-tip">*</span>家庭人均年收入（元）</td>
                  <td colspan="3">
                      <div style="display: flex;align-items: center;">
                          {{capita}}
                          元
                      </div>
                  </td>
              </tr>
        <!-- 换行 -->
              <tr style="page-break-after: always;">&nbsp;</tr>
          <tr style="padding:40px"><td class="split">aaa</td></tr>
        <tr>

          <td class="table-label" colspan="6">影响家庭经济状况信息</td>
        </tr>
        <!--影响家庭经济状况信息  -->
        <tr>
          <td class="table-label">家庭经济主要收入来源</td>
          <td class="table-input">
              {{formData.jtzysrStr}}
           <!-- {{formData.jtzysr!=null?formData['jtzysr'].join("，"):""}} -->
          </td>
          <td class="table-label">其他收入说明</td>
          <td class="table-input" colspan="3">
           
             
                {{formData.jtzysr2}}
             
           
           
            
          </td>
        </tr>
        <tr>
          <td class="table-label">学生父母丧失劳动能力或劳动能力弱（单位：人）</td>
          <td class="table-input">
            {{formData.ssldnl}}
          </td>
          <td class="table-label">需赡养丧失劳动能力的共同生活家庭成员（单位：人）</td>
          <td class="table-input" >
            {{formData.zyssldnl}}

          </td>

          <td class="table-label">患病残疾人（单位：人）</td>
          <td class="table-input" >
            {{formData.hbcjr}}
          </td>
        </tr>
        <!-- 突发事件 -->
        <tr>
          <td class="table-label">突发事件</td>
          <td class="table-input" >
            {{formData.tfsjStr}}
            <!-- {{formData.tfsj!=null?formData['tfsj'].join("，"):""}} -->
          </td>
          <td class="table-label">其他情况</td>
          <td class="table-input" >
            {{formData.tfsj3}}
          </td>

        <td class="table-label">具体时间、内容及涉及金额等情况</td>
          <td class="table-input">
            
            {{formData.tfsj2}}
          </td>
        </tr>
        <!-- <tr>
        
        </tr> -->

        <!-- 申请理由及个人承诺 -->
        <tr>
          <td class="table-label" colspan="6">申请理由及个人承诺</td>
        </tr>
        <tr>
          <td class="table-label">申请理由</td>
          <td class="table-input" style="text-align:left;"  colspan="5">
            <el-form-item prop="sqly">
                          {{
                formData.sqly
              }}
                      </el-form-item>
          </td>
        </tr>
        <!-- 个人承诺 -->
        <tr>
          <td class="table-label">个人承诺</td>
          <td class="table-input" style="text-align:left;" colspan="5">
            本人承诺以上所填资料真实、准确，并同意授权相关部门通过信息核对，对所填资料进行查询、核对。
                    如虚报资料，本人愿意承担相关责任。
          </td>
        </tr>
        <!-- 个人签名 -->
        <tr>
          <td class="table-label">个人签名</td>
          <td class="table-input" style="text-align:left;" colspan="5">
            <div tyle="display: flex; justify-content: space-between;">
              <div >
                同意
              </div>
              <div style="display: flex; justify-content: flex-end;margin-right: 10px;gap:10px">
                <span>
          
                  <img v-if="formData.sqrqm" :src="baseurl+formData.sqrqm" class="signature-img">
                  <span class="signature-tip" v-else>签名</span>
 
                </span>
                <div class="newSign">
                  <div>
                    <span>{{formData.xm}} </span>
                    <!-- <span>{{formData.xh}}</span> -->
                  </div>
                  <div>{{formData.stuTime}}</div>
                </div>
              </div>
            </div>
          </td>
        </tr>
        <!-- 班级意见 -->
        <tr>
          <td class="table-label">班级意见</td>
          <td class="table-input" style="text-align:left;" colspan="5">
            
            <div tyle="display: flex; justify-content: space-between;">
              <div >
                经审查，本学年该同学
                <br>符合家庭经济困难学生认定条件，推荐认定困难类型为：
                <span v-if="formData.bjpyyj == '1'">特别困难</span>
                <span v-if="formData.bjpyyj == '2'">比较困难</span>
                <span v-if="formData.bjpyyj == '3'">一般困难</span>
                <span v-if="formData.bjpyyj == '4'">不困难</span>
              
              </div>
              <div style="display: flex; justify-content: flex-end;margin-right: 10px;gap:10px;margin-top:66px;">
                <span>
             
                    <img v-if="formData.fdyqm" :src="baseurl+formData.fdyqm" class="signature-img">
                    <span class="signature-tip" v-else>签名</span>
                
                </span>
                <div  class="newSign">
                  <div>
                    <span>{{formData.fdymc}} </span>
                    <!-- <span>{{formData.fdygh}}</span> -->
                  </div>
                  <div>{{formData.fdyTime}}</div>
                </div>
              </div>
            </div>
          </td>
        </tr>
        <!-- 二级学院认定意见 -->
        <tr style="height:250px">
          <td class="table-label">二级学院认定意见</td>
          <td class="table-input" style="text-align:left;" colspan="5">
            <div tyle="display: flex; justify-content: space-between;">
              <div >
                经审查，本学年该同学
                <br>符合家庭经济困难学生认定条件，推荐认定困难类型为：
                <span v-if="formData.ejxyldqmyj == '1'">特别困难</span>
                <span v-if="formData.ejxyldqmyj == '2'">比较困难</span>
                <span v-if="formData.ejxyldqmyj == '3'">一般困难</span>
                <span v-if="formData.ejxyldqmyj == '4'">不困难</span>
              
              </div>
              <div style="display: flex; justify-content: flex-end;margin-right: 10px;gap:10px;margin-top:66px;">
                <span>
      
                
                    <img v-if="formData.ejxyldqm" :src="baseurl+formData.ejxyldqm" class="signature-img">
                    <span class="signature-tip" v-else>签名</span>
    
                </span>
                <div  class="newSign">
                  <div>
                    <span>{{formData.ejxyldmc}} </span>
                    <!-- <span>{{formData.ejxyldgh}}</span> -->
                  </div>
                  <div>{{formData.xsjTime}}</div>
                </div>
              </div>
            </div>
          </td>
        </tr>
        <!-- 学校认定意见 -->
        <tr style="height:250px">
          <td class="table-label">学校认定意见</td>
          <td class="table-input" style="text-align:left;" colspan="5">
            <div tyle="display: flex; justify-content: space-between;">
              <div >
                经审查，本学年该同学
                <br>符合家庭经济困难学生认定条件，推荐认定困难类型为：
                <span v-if="formData.xsqmyj == '1'">特别困难</span>
                <span v-if="formData.xsqmyj == '2'">比较困难</span>
                <span v-if="formData.xsqmyj == '3'">一般困难</span>
                <span v-if="formData.xsqmyj == '4'">不困难</span>
              
              </div>
              <div style="display: flex; justify-content: flex-end;margin-right: 10px;gap:10px;margin-top:66px;">
                <span>
           
                    <img v-if="formData.xsqm" :src="baseurl+formData.xsqm" class="signature-img">
                    <span class="signature-tip" v-else>签名</span>
               
                </span>
                <div  class="newSign">
                  <div>
                    <span>{{formData.xsmc}} </span>
                    <!-- <span>{{formData.xsgh}}</span> -->
                  </div>
                  <div>{{formData.deptTime}}</div>
                </div>
              </div>
            </div>
          </td>
        </tr>
          

            </table>
          </el-form>

        </div>

        <span slot="footer" class="dialog-footer" >
          <el-button @click="open = false" size="small">取 消</el-button>
             <el-button type="success"  v-print="printobj"  size="small">打印</el-button>
			   <!-- <el-button type="danger"  @click="exportToPDF"  size="small">导出为PDF</el-button> -->
          <!-- <el-button type="primary" @click="startPrint" size="small">确 定</el-button> -->
        </span>
      </el-dialog>

      <div style="margin: 10px  ;text-align: center;" v-if="action != 3">
        <!-- 辅导员也可以修改信息 -->
         <el-button type="success" v-if="formData.step == 2" @click="fdySave">保存信息</el-button>
        <el-button type="success" v-if="formData.step == 1 || formData.step==0" @click="onSubmit(0)">保存信息</el-button>
        <el-button type="primary" v-if="formData.step == 1 || formData.step==0" @click="onSubmit(1)">提交申请</el-button>

        <el-button type="success"  @click="printHtml">打印</el-button>

        <el-button type="primary" v-if="formData.step == 2 && this.state==0" @click="onSubmit(2)">确认提交</el-button>
        <el-button type="primary" v-if="formData.step == 3 && this.state==0" @click="onSubmit(3)">确认提交</el-button>
        <el-button type="primary" v-if="formData.step == 4 && this.state==0" @click="onSubmit(4)">确认提交</el-button>
        <el-button type="warning" v-if="(formData.step==2 || formData.step==3 || formData.step==4) && this.state==0"  @click="rejectDialogVisible = true">驳回</el-button>
        <!-- <el-button v-if="formData.step != 1 && formData.step != 5" type="danger" @click="on">审核不通过</el-button> -->
        <el-button type="primary"  v-if="formData.step==5" @click="next(4)">下一个</el-button>
     
      </div>
      <div v-if="action == 3" style="margin: 10px  ;text-align: center;">
          <el-button type="success"  @click="printHtml">打印</el-button>
      </div>
      注：1.本表供学生根据需要申请家庭经济困难认定用，可复印。2.选择性项目必须填写。3.学校审核意见负责人签章（盖章）：高等学校为校学生资助工作领导小组组长或学生资助中心主要负责人签章，加盖资助中心公章；其他学段学校为学校校长签章，加盖学校公章。

      <el-dialog title="编辑家庭成员" width="1600px" top="25vh" :visible.sync="dialogTableVisible" @close="getFamily">
        <FamilyMemberKnrd :stuNo="formData.xh" v-if="formData.step == 2"></FamilyMemberKnrd>
        <FamilyMember :stuNo="formData.xh" v-if="formData.step== 1 || formData.step == 0 "></FamilyMember>
      </el-dialog>

      <div class="record">
        <div class="title">
          <span>审核记录</span>

        </div>
        <el-timeline v-loading="recordLoading">
          <el-timeline-item v-for="(item,index) in recordList" :key="index" :icon="item.icon" size="large"
            :type='item.type' :timestamp="item.createTime" placement="top">
            <el-card>
               <h3 v-if="item.step == -1">
                <p>
                  <span>撤回</span>
               
                </p>
              </h3>
              <h3 v-if="item.step == 0 ">
                <p>
                  <span>保存</span>
               
                </p>
              </h3>
              <h3 v-if="item.step == 1 ">
                <p>
                  <span>提交申请</span>
               
                </p>
              </h3>
              <!-- <h3 v-if="item.step == 1 ">提交申请</h3>  -->
              <h3 v-if="item.step == 2 ">
                <p>
                  <span>辅导员审核：</span>
                  <span v-if="item.status==1" style="color:#55aa00">特别困难</span>
                  <span v-if="item.status==2" style="color:#55aa00">比较困难</span>
                  <span v-if="item.status==3" style="color:#55aa00">一般困难</span>
                  <span v-if="item.status==4" style="color:#ff2200">不困难</span>
                   <span v-if="item.status==5" style="color:#ff2200">驳回</span>

                   <span  v-if="item.status==5">
                      <span style="display:inline-block;width:10px;"></span>原因：{{item.remark}}
                   </span>
                </p>
              </h3>
              <h3 v-if="item.step == 3 ">
                <p>
                  <span>二级学院审核：</span>
                  <span v-if="item.status==1" style="color:#55aa00">特别困难</span>
                  <span v-if="item.status==2" style="color:#55aa00">比较困难</span>
                  <span v-if="item.status==3" style="color:#55aa00">一般困难</span>
                  <span v-if="item.status==4" style="color:#ff2200">不困难</span>
                   <span v-if="item.status==5" style="color:#ff2200">驳回</span>
                   <span  v-if="item.status==5">
                      <span style="display:inline-block;width:10px;"></span>原因：{{item.remark}}
                   </span>
                </p>
              </h3>
              <h3 v-if="item.step == 4 ">
                <p>
                  <span>学校审核：</span>
                  <span v-if="item.status==1" style="color:#55aa00">特别困难</span>
                  <span v-if="item.status==2" style="color:#55aa00">比较困难</span>
                  <span v-if="item.status==3" style="color:#55aa00">一般困难</span>
                  <span v-if="item.status==4" style="color:#ff2200">不困难</span>
                    <span v-if="item.status==5" style="color:#ff2200">驳回</span>
                    <span  v-if="item.status==5">
                      <span style="display:inline-block;width:10px;"></span>原因：{{item.remark}}
                   </span>
                </p>
              </h3>
              <p>操作人：{{item.approver}} </p>
            </el-card>
          </el-timeline-item>
        </el-timeline>
      </div>
    </div>

    <!-- 驳回 -->
    <el-dialog
        class="reject"
        title="驳回"
        :visible.sync="rejectDialogVisible"
        width="30%"
        >
        <el-form ref="form" :model="form" label-width="80px" size="small">
            <el-row v-if="formData.step == 2">
                <el-form-item label="驳回至">
                    <el-select v-model="form.targetStep" placeholder="请选择">
                        <el-option label="学生" value="0"></el-option>
                    </el-select>
                </el-form-item>
              </el-row>
              <el-row v-if="formData.step == 3">
                <el-form-item label="驳回至">
                    <el-select v-model="form.targetStep" placeholder="请选择">
                        <el-option label="学生" value="0"></el-option>
                        <el-option label="辅导员意见" value="2"></el-option>
                    </el-select>
                </el-form-item>
              </el-row>
              <el-row v-if="formData.step ==4">
                <el-form-item label="驳回至">
                    <el-select v-model="form.targetStep" placeholder="请选择">
                        <el-option label="学生" value="0"></el-option>
                        <el-option label="辅导员意见" value="2"></el-option>
                        <el-option label="二级学院意见" value="3"></el-option>
                    </el-select>
                </el-form-item>
              </el-row>
              <div style="height:20px;"></div>
            <el-row>

            <el-form-item label="原因">
                        <el-input type="textarea"  placeholder="请输入驳回原因" v-model="form.remark"></el-input>
                    </el-form-item>
            </el-row>
  
            </el-form>
        <span slot="footer" class="dialog-footer">
            <el-button @click="rejectDialogVisible = false"  size="small">取 消</el-button>
            <el-button type="primary" @click="submitReject"  size="small">确 定</el-button>
        </span>
    </el-dialog>
  </div>
</template>

<script>
  import {
  getToken
} from "@/utils/auth";
  
import { listKnrdtime } from "@/api/comprehensive/knrdtime";
import { queryByStuNo } from "@/api/comprehensive/knrdtype";
import {
  getOwnInfo as extraInfo
} from "@/api/stuCQS/basedata/extraInfo";
import {
  getOwnFamily,
  getOwnFamilyFdy
} from "@/api/stuCQS/basedata/member";
import { getUserProfile, updateSignature } from "@/api/system/user";
import { getStudentInfo } from "@/api/zxj/apply";
import {
  addApply,
  fdyNext,
  fdySave,
  getApply,
  getStuByXh,
  getxh,
  infoCheck,
  jwcNext,
  nopass,
  reject,
  unlock,
  updateApply,
  xwNext
} from "@/api/zxj/poverty/apply";
import {
  listRecord
} from "@/api/zxj/poverty/record";
import FamilyMember from "@/views/basedata/private/components/FamilyMember.vue";
import FamilyMemberKnrd from "@/views/basedata/private/components/FamilyMemberKnrd.vue";
import {
  Message
} from 'element-ui';

   import {
  getOwnInfo as stuInfoView
} from "@/api/stuCQS/basedata/stuInfoView";

  import signature from '@/components/signature/index.vue';
import html2canvas from 'html2canvas';
import jsPDF from 'jspdf';



  export default {
    components: {
      FamilyMember,
      signature,
        FamilyMemberKnrd
 
    },
    data() {
		
		  var sqlyValidate = (rule, value, callback) => {


        let searchString = /助学金|补助/;
        let regex = new RegExp(searchString, 'g');
        let result  = regex.test(value);
        if(result){
          
          callback(new Error('申请理由不能有“助学金”、“补助”等字眼'));
              }else{
          callback();
        }
			
      };
      return {
          nextLoading:false,
          rejectDialogVisible:false,
          action:null,
          printLoading:false,
          printobj:{
            id: 'print',
            popTitle: '打印', // 打印配置页上方标题
            extraHead: '', //最上方的头部文字，附加在head标签上的额外标签,使用逗号分隔
            preview: '', // 是否启动预览模式，默认是false（开启预览模式，可以先预览后打印）
            previewTitle: '', // 打印预览的标题（开启预览模式后出现）,
            previewPrintBtnLabel: '', // 打印预览的标题的下方按钮文本，点击可进入打印（开启预览模式后出现）
            zIndex: '', // 预览的窗口的z-index，默认是 20002（此值要高一些，这涉及到预览模式是否显示在最上面）
            previewBeforeOpenCallback() {}, //预览窗口打开之前的callback（开启预览模式调用）
            previewOpenCallback() {}, // 预览窗口打开之后的callback（开启预览模式调用）
            beforeOpenCallback() {
                
            }, // 开启打印前的回调事件
            openCallback() {}, // 调用打印之后的回调事件
            closeCallback() {}, //关闭打印的回调事件（无法确定点击的是确认还是取消）
            url: '',
            standard: '',
            extraCss: '',
        },
        open:false,
        user:{signature:null},
        accpet:'image/*',
        recordLoading: false,
        dialogTableVisible: false,
        upload: {
          headers: {
            Authorization: "Bearer " + getToken()
          },

          // 上传的地址
          url: process.env.VUE_APP_BASE_API + "/common/upload"
        },
        baseurl: process.env.VUE_APP_BASE_API + "/",
        form:{},
        formData: {
			"jg":null,
			"nj":null,
			"bj":null,
			"phone":null,
          "jtzysr2": "",
          "parentstel": "",
          "affixId": null,
          "createBy": "",
          "createTime": "",
          "updateBy": "",
          "updateTime": "",
          "remark": "",
          "id": "",
          "step": 1,
          "xm": "",
          "xb": "",
          "mz": "",
          "sfzhm": "",
          "xh": "",
          "csny": "",
          "knlx": "",
          "knlx2": "",
          "rkzs": "",
          "srly": "",
          "hjxz": "",
          "hjszd": "",
          jtcyObj: [

          ],
          jtcy: [{
            xm: "",
            nl: "",
            yxsgx: "",
            gzdw: "",
            zy: "",
            nsr: "",
            jkzk: "",
            gx: ""
          }],
          "jtjzfqk": null,
          "jtqcqk": null,
          "jtxjzdz": null,
          "jzdh": null,
          "jtnsr": null,
          "rjnsr": null,
          "jtzysr": [],
          "ssldnl": null,
          "hbcjr": null,
          "zyssldnl": null,
          "tfsj": [],
          "sqrqm": null,
          "sqrqmrq": "",
          "bjpyyj": null,
          "pyxzzzqm": null,
          "pyxzzzqmrq": null,
          "ejxyfzrqm": "",
          "fdyqm": null,
          "fdyqmrq": "",
          "ejxyldqmyj": null,
          "ejxyldqm": "",
          "ejxyldqmrq": "",
          "xsqmyj": null,
          "xsqm": "",
          "xsqmrq": "",
          "createId": null,
          "xsqmyjstate": null,
          "ejxyldqmyjstate": null,
          "bjpyyjstate": null
        },
        rules: [{

          required: true,
          message: '此项必填'
        }],
        rulestel: [{
          required: true,
          message: '此项必填'
        }, {
          min: 11,
          max: 11,
          message: "只能输入11位数字"
        }],
        selerules: [{
          required: true,
          message: '必选一项'
        }],
		textAreaRules:[
			  { required: true, message: '此项必填', trigger: 'blur' },
			{min:100,max:200, trigger: 'blur',message:"申请理由字数限制100-200字" },
			{
				validator:sqlyValidate,trigger: 'blur'
			}
			
		],
        state: 0,
        index: null,
        recordList: [],
        data: [],
        indexs: 0,
        nation: [
          "阿昌族",
          "鄂温克族",
          "傈僳族",
          "水族",
          "白族",
          "高山族",
          "珞巴族",
          "塔吉克族",
          "保安族",
          "仡佬族",
          "满族",
          "塔塔尔族",
          "布朗族",
          "哈尼族",
          "毛南族",
          "土家族",
          "布依族",
          "哈萨克族",
          "门巴族",
          "土族",
          "朝鲜族",
          "汉族",
          "蒙古族",
          "佤族",
          "达斡尔族",
          "赫哲族",
          "苗族",
          "维吾尔族",
          "傣族",
          "回族",
          "仫佬族",
          "乌孜别克族",
          "德昂族",
          "基诺族",
          "纳西族",
          "锡伯族",
          "东乡族",
          "京族",
          "怒族",
          "瑶族",
          "侗族",
          "景颇族",
          "普米族",
          "彝族",
          "独龙族",
          "柯尔克孜族",
          "羌族",
          "裕固族",
          "俄罗斯族",
          "拉祜族",
          "撒拉族",
          "藏族",
          "鄂伦春族",
          "黎族",
          "畲族",
          "壮族",
        ]
      }
    },
    destroyed() {
      localStorage.setItem("knList", "[]")
    },
    created() {
      //获取
      let date = new Date();
      let month = date.getMonth() + 1
      if (this.formData.step == 1) {
        this.formData.sqrqmrq = date.getFullYear() + "/" + month + "/" + date.getDate() ;
      }
      let id = this.$route.query.id;
       this.action = this.$route.query.action;
      this.state = this.$route.query.she ? this.$route.query.she : 0
      this.data = JSON.parse(localStorage.getItem("knList"))
      // let id = 22;
      if (id) { //存在id是编辑
        this.getRecordList(id)
        this.getInfo(id, date, month);
       
        //this.getUserSignature();
       
      } else { //添加，初始化数据
        infoCheck().then(res => {

          if (res.code == 0) {

            if (res.data.code == 0) {

              this.$alert("基础信息未完善！（备注：白底照片也需要上传）", '提示', {
                confirmButtonText: '确定',
                type: 'warning'
              }).then(() => {
                this.$router.push({
                  path: "/basedata/stuOwnInfo/edit"
                })
              }).catch(() => {
                this.$tab.closePage();
              });
            } else {

              this.$alert(res.msg, '提示', {
                confirmButtonText: '确定',
                type: 'warning'
              }).then(() => {
                this.$tab.closePage();
              }).catch(() => {
                this.$tab.closePage();
              });
            }

          } else {
            this.init();
            this.getUserSignature();
          }
        })

      }

    },
    methods: {
      saveSuccessHandle(url){
        this.formData.sqrqm = url;
      },
		exportToPDF() {
			const pdfName = this.formData.xm +"（" +  this.formData.applyYear+ '）广西水利电力职业技术学院家庭经济困难学生认定申请表.pdf'; // 定义导出的PDF文件名
			const element = document.getElementById('print'); // 获取需要导出的页面元素的id，可以根据需要修改
			html2canvas(element).then(canvas => {
				// 将页面转换为canvas
				const pdf = new jsPDF('p', 'mm', 'a4');
				const imgData = canvas.toDataURL('image/png');

		
				pdf.addImage(imgData, 'PNG', 0, 0, 210, 297); // 将canvas添加为PDF的一页，可以根据需要修改尺寸
				// pdf.rect(0, 0, 210, 297, 'stroke'); 
				pdf.save(pdfName); // 下载导出的PDF文件
			});
		},
      	submitReject(){
            if(!this.form.targetStep){
                this.$modal.msgError("请选择驳回目标");
                return;
            }
            if(!this.form.remark){
                this.$modal.msgError("请输入原因");
                return;
            }
            let params = {
                    "targetStep":this.form.targetStep,
                    "remark":this.form.remark,
                    "step":this.formData.step ,
                    "applyId":this.formData.id,
                    "status":5,
            }
            reject(params).then(response => {
                  if(response.code !=500){
                      this.rejectDialogVisible = false;
                      unlock({id:this.formData.id});
                      this.next(this.formData.step);
                  }
            });
      	},
      	getUserSignature() {
            getUserProfile().then(response => {
             
                if(this.formData.step == 2   && this.action !=3){
                    console.log("获取辅导员签名");
                    this.formData.fdyqm = response.data.signature;
                }
                if(this.formData.step == 3    && this.action !=3){
                     console.log("获取二级学院领导签名");
                    this.formData.ejxyldqm = response.data.signature;
                }
                if(this.formData.step == 4    && this.action !=3){
                     console.log("获学校领导签名");
                    this.formData.xsqm = response.data.signature;
                }
                if(this.formData.step == 1   && this.action !=3){
                    console.log("获取学生签名");
                    this.formData.sqrqm= response.data.signature;
                }
                this.$forceUpdate();
            });    
        },
      	getLabel(index) {
			if (index == 1) {
				return "特别困难"
			} else if (index == 2) {
				return "比较困难"
			} else if (index == 2) {
				return "一般困难"
			} else if (index == 2) {
				return "不困难"
			}
      	},
      //查询审核记录
      getRecordList(id) {
        // 查询审批流程
        this.recordLoading = true;
        listRecord({
          applyId: id
        }).then(response => {
          this.recordList = [];
          let rows = response.rows;
          for (let idx = 0; idx < rows.length; idx++) {
            let row = rows[idx];
            if (row.step == -1) {
              row['text'] = "撤回";
            }
            if (row.step == 0) {
              row['text'] = "保存";
            }
            if (row.step == 1) {
              row['text'] = "提交申请";
            }
            if (row.step == 2) {
              row['text'] = "辅导员审核";
            }
            if (row.step == 3) {
              row['text'] = "二级学院审核";
            }
            if (row.step == 4) {
              row['text'] = "学校审核";
            }
            //el-icon-remove-outline el-icon-circle-check el-icon-circle-close
            // if (row.status == '0') {
            //   //拒绝
            //   row['icon'] = 'el-icon-circle-close';
            //   row['color'] = '#F56C6C'
            //   row['type'] = 'danger';
            //   row['result'] = "拒绝";
            // }
            // if (row.status == '1') {
            //   //通过
            //   row['icon'] = 'el-icon-circle-check';
            //   row['color'] = '#67C23A'
            //   row['type'] = 'success';
            //   row['result'] = "审核通过";
            // }

            // if (row.status == '2') {
              // 驳回
              row['icon'] = 'el-icon-check';
              row['color'] = '#E6A23C'
              row['type'] = 'success';
              row['result'] = "驳回";
            // }

            this.recordList.push(row);
          }
          this.recordLoading = false;


        });
      },
      getInfo(id, date, month) {
        getApply(id).then(response => {
            if(response.code != 200){
                this.$modal.msgError("无权访问");
                  this.$tab.closePage();
                return;
            }
            if( response.data.jtzysr && response.data.jtzysr != "" && response.data.jtzysr !=null){
               response.data.jtzysr = response.data.jtzysr.split("，");
            }else{
               response.data.jtzysr = []
            }
            
            if( response.data.tfsj && response.data.tfsj != "" &&  response.data.tfsj != null){
                response.data.tfsj = response.data.tfsj.split("，");
            }else{
                response.data.tfsj=[]
            }
            
          	this.formData = {
            	...this.formData,
            	...response.data
          	}

          this.formData.jtcyObj = JSON.parse(response.data.jtcy);
          if (this.$route.query.show) { //学生进来只进行查看
            this.formData.step = 6
          }
          // console.log(this.$route.query.edit && this.formData.step == 2);
          // if (this.$route.query.edit && this.formData.step == 2) { //学生进来，且辅导员没有审核
          //   this.formData.step = 1
          // }
          if (this.formData.step == 2) {
            this.formData.fdyqmrq = date.getFullYear() + "/" + month + "/" + date.getDate() ;
          }
          if (this.formData.step == 3) {
            this.formData.ejxyldqmrq = date.getFullYear() + "/" + month + "/" + date.getDate() ;
          }
          if (this.formData.step == 4) {
            this.formData.xsqmrq = date.getFullYear() + "/" + month + "/" + date.getDate();
          }
          // // this.getFamily()
           this.$refs.formData.resetFields();
           this.getUserSignature();
           this.formData.knlx= this.formData.knlx==null||this.formData.knlx==''?"无":this.formData.knlx;
           this.$forceUpdate();
           
          //  this.$refs.formData.clearValidate(['sqrcn'])
        });
      },
      init() {
        getxh().then(res => {
          if (res.code == 200) {
            this.formData.xh = res.data.stuNo;
            this.formData.sfzhm = res.data.idCard
            this.formData.xm = res.data.name
            this.formData.xb = res.data.gender
            this.formData.csny = res.data.birthday
            this.formData.phone = res.data.phone;
            this.getOwnInfo()
            this.getFamily()
         
            this.getCurrentYearFun()
            // this.getStudent();
          }
        })
      },
      //获取学年
      getCurrentYearFun(){
          let year =  JSON.parse(sessionStorage.getItem("knrdSelectedYear"));
          this.formData.applyYear = year.stuYearName;
          this.formData.stuYearId = year.id;
           this.getKnlx();
          // getCurrentYear().then(res=>{
          //   this.formData.applyYear = res.data.stuYearName;
          //   this.formData.stuYearId = res.data.id;
			    //   this.getKnlx()
          // })
      },
      //根据学号查询学生信息
        getStudent(){
            getStudentInfo({"stuNo":this.formData.xh}).then(res=>{
                //精确查找到
                if(res.data){
                    this.formData.xy = res.data.dept==null?"":res.data.dept.deptName;
                    this.formData.bj = res.data.srsClass.className;
                    this.formData.nj = res.data.srsClass.className.substring(0,4) ;
                 
                }   
            })
        },
      getKnlx(){
        queryByStuNo({stuNo: this.formData.xh,stuYearId:this.formData.stuYearId}).then(res=>{
            if(res.code == 200 ){
                this.formData.knlx =res.data? res.data.knrdType:"无";
            }
        })
      },
      getOwnInfo() {
        extraInfo().then(obj => {
           this.formData.jg = obj.data.jg;
           this.formData.mz = obj.data.mz;
           this.formData.hjxz = obj.data.hkxz;
           this.formData.hjszd = obj.data.hksz1 + obj.data.hksz2 + obj.data.hksz3;
           this.formData.jtxjzdz = obj.data.xxlxdz;

            this.$forceUpdate();
        });

        stuInfoView().then(res=>{
            this.formData.xy =  res.data.deptName;
            this.formData.bj = res.data.className;
            this.formData.nj =res.data.gradeName;
        });

      },
      getFamily() {
        if(this.formData.step == 2){
            getOwnFamilyFdy(this.formData.xh).then(obj => {
              if (obj.code == 200) {
                var arr = obj.data
                this.formData.jtcyObj = []
                if (arr.length > 0) {
                  for (var i = 0; i < arr.length; i++) {

                    var obj = {}
                    obj.xm = arr[i].familyName
                    obj.nl = arr[i].age
                    obj.gx = arr[i].familyRelation
                    if (arr[i].familyRelation.indexOf("父子")  != -1  || arr[i].familyRelation.indexOf("母子")  != -1  ||
                      arr[i].familyRelation.indexOf("父女")  != -1  || arr[i].familyRelation.indexOf("母女")  != -1 )  {
                      this.formData.jzdh = arr[i].familyName
                      this.formData.parentstel = arr[i].phone
                    }
                    obj.gzdw = arr[i].workPlace
                    obj.zy = arr[i].job
                    obj.jkzk = arr[i].health
                    obj.tel = arr[i].phone
                    obj.nsr = arr[i].yearMoney
                    obj.dw = arr[i].workPlace
                    this.formData.jtcyObj.push(obj)
                    this.formData.rkzs = arr.length + 1
                  }
                }
              }
            });
        }else{

         
            getOwnFamily().then(obj => {
              if (obj.code == 200) {
                var arr = obj.data
                this.formData.jtcyObj = []
                if (arr.length > 0) {
                  for (var i = 0; i < arr.length; i++) {

                    var obj = {}
                    obj.xm = arr[i].familyName
                    obj.nl = arr[i].age
                    obj.gx = arr[i].familyRelation
                    if (arr[i].familyRelation.indexOf("父子") != -1  || arr[i].familyRelation.indexOf("母子") != -1 ||
                      arr[i].familyRelation.indexOf("父女") != -1 || arr[i].familyRelation.indexOf("母女") != -1) {
                      this.formData.jzdh = arr[i].familyName
                      this.formData.parentstel = arr[i].phone
                    }
                    obj.gzdw = arr[i].workPlace
                    obj.zy = arr[i].job
                    obj.jkzk = arr[i].health
                    obj.tel = arr[i].phone
                    obj.nsr = arr[i].yearMoney
                    obj.dw = arr[i].workPlace
                    this.formData.jtcyObj.push(obj)
                    this.formData.rkzs = arr.length + 1
                  }
                }
              }
            });
        }
      },
      startPrint(){
   
          printJS({
            printable: 'print', // 标签元素id
            type: 'html',
            header: '',
           
            targetStyles: ['*'],
            ignoreElements: ['editFamily', "affix1", "affix2"]
          });
      },
      printHtml() {
        this.open = true;
        this.printLoading = true;
        listKnrdtime({"stuNo":this.formData.xh,stuYearId:this.formData.stuYearId}).then(res=>{
            if(res.rows && res.rows.length > 0){
            this.formData.stuTime = res.rows[0].stuTime;
            this.formData.fdyTime = res.rows[0].fdyTime;
            this.formData.xsjTime = res.rows[0].xsjTime;
            this.formData.deptTime = res.rows[0].deptTime;
            }
			else{
				this.formData.stuTime = this.formData.sqrqmrq;
				this.formData.fdyTime = this.formData.fdyqmrq;
				this.formData.xsjTime =this.formData.ejxyldqmrq; 
				this.formData.deptTime =this.formData.xsqmrq;
			}
             this.printLoading = false;
                             this.$forceUpdate();


          if(this.formData.jtzysr){
              this.formData.jtzysrStr = this.formData.jtzysr.join("，")
          }
            if(this.formData.tfsj){
              this.formData.tfsjStr = this.formData.tfsj.join("，")
          }                   
        });
        // const style = '@page {margin:0 10mm};'
      
        //各个配置项
        //printable:要打印的id。
        //type:可以是 html 、pdf、 json 等。
        //properties:是打印json时所需要的数据属性。
        //gridHeaderStyle和gridStyle都是打印json时可选的样式。
        //repeatTableHeader:在打印JSON数据时使用。设置为时false，数据表标题将仅在第一页显示。
        //scanStyles:设置为false时，库将不处理应用于正在打印的html的样式。使用css参数时很有用，此时自己设置的原来想要打印的样式就会失效，在打印预览时可以看到效果
        //targetStyles: [’*’],这样设置继承了页面要打印元素原有的css属性。
        //style:传入自定义样式的字符串，使用在要打印的html页面 也就是纸上的样子。
        //ignoreElements：传入要打印的div中的子元素id，使其不打印。非常好用
      },
      resetknlx2() {
        // console.log(this.formData.knlx2)
        this.formData.knlx2 = ""
        // console.log(this.formData.knlx2)
      },
      getApplyxq(id) {
        getApply(id).then(response => {
          this.formData = {
            ...this.formData,
            ...response.data
          }
        })
      },
      handleAffix(affixId) {
        this.formData.affixId = affixId;
      },
      inputHandler() {
        if (this.formData.step == 1) { //学生不允许根据学号查询数据
          return
        }
        this.formData.xh = this.formData.xh.replace(" ", "")
        if (this.formData.xh.length >= 10) {
          getStuByXh({
            xh: this.formData.xh
          }).then(res => {
            this.formData.sfzhm = res.data.idCard
            this.formData.xm = res.data.name
            this.formData.xb = res.data.gender
            this.formData.csny = res.data.birthday
            this.formData.jtxjzdz = res.data.address
            var arr = res.data.srsFemilyMenberList
            if (this.formData.jtcyObj.length <= 1) {
              for (var i = 0; i < arr.length; i++) {
                var obj = {}
                obj.xm = arr[i].kinsfolkName
                obj.nl = arr[i].fatehrAge
                obj.gx = arr[i].kinsfolkRelate
                obj.gzdw = arr[i].workUnit
                obj.zy = arr[i].duty
                obj.jkzk = arr[i].healthCondition
                this.formData.jtcyObj.push(obj)
              }
            }

          })
        }


      },
      doUpdateSignature(){
        updateSignature(this.user).then(res=>{});
      },
      fdySave(){
        if(this.formData.jtzysr instanceof Array){
             this.formData.jtzysr =  this.formData.jtzysr.join("，");
        }
        if(	  this.formData.tfsj instanceof Array){
            this.formData.tfsj =  this.formData.tfsj.join("，");
        }
     
  		
        this.formData.jtcy = JSON.stringify(this.formData.jtcyObj);
          this.formData.step = 2;
           fdySave(this.formData).then(res => {
                if (res.code == 200) {
                  this.$modal.msgSuccess("提交成功");
       
 
                  this.$tab.closePage();
                  
                }
           })
      },
	
      onSubmit(stu) { //提交申请

			if( this.formData.jtzysr instanceof Array){

				this.formData.jtzysr =  this.formData.jtzysr.join("，");
			}else{
        this.formData.jtzysr = null;
      }

			if(  this.formData.tfsj instanceof Array){
				this.formData.tfsj =  this.formData.tfsj.join("，");
			}else{
        this.formData.tfsj = null;
      }
          
        if(stu == 0  ){
         
            if(!this.formData.id){
              
              //新增
              if(this.formData.xh==null || this.formData.xh == ''){
                Message({
                  message: '请填写学号',
                  type: 'error'
                });
                return;
              }else{
                  this.formData.jtcy = JSON.stringify(this.formData.jtcyObj)
                  this.formData.step = stu
                  addApply(this.formData).then(res => {
                    if (res.code == 200) {
                      this.$modal.msgSuccess("保存成功");
                      this.user.signature = this.formData.sqrqm;
                      this.doUpdateSignature();
                      this.$tab.closePage();
                    }
                  })
              }
            }else{
                  this.formData.jtcy = JSON.stringify(this.formData.jtcyObj)
                  this.formData.step = stu ;
                  updateApply(this.formData).then(res => {
                    if (res.code == 200) {
                      this.$modal.msgSuccess("提交成功");
                      this.doUpdateSignature();
                      this.$tab.closePage();
                      // }
                    }
                  });
            

          }
           return;
        }
        this.$refs['formData'].validate((valid) => {
          if (valid) {
            if (stu == 1) { //提交认定
              this.formData.jtcy = JSON.stringify(this.formData.jtcyObj)
              this.formData.step = stu
              if (!this.formData.sqrqm) {
                Message({
                  message: '请上传签名图片',
                  type: 'error'
                })
                return
              }
    
              addApply(this.formData).then(res => {
                if (res.code == 200) {
                  this.$modal.msgSuccess("提交成功");
                  this.user.signature = this.formData.sqrqm;
                  this.doUpdateSignature();
                  this.$tab.closePage();
                  
                }
              })
            } 
            else if (stu == 0) { //保存信息
              // if (!this.formData.affixId) {
              //   Message({
              //     message: '请上传佐证材料',
              //     type: 'error'
              //   })
              //   return
              // }
              this.formData.jtcy = JSON.stringify(this.formData.jtcyObj)
              this.formData.step = stu
              addApply(this.formData).then(res => {
                if (res.code == 200) {
                  this.$modal.msgSuccess("保存成功");
                  this.user.signature = this.formData.sqrqm;
                  this.doUpdateSignature();
                  this.$tab.closePage();
                }
              })
            } else {
              if (stu == 2) {
                if (!this.formData.fdyqm) {
                  Message({
                    message: '请上传签名图片',
                    type: 'error'
                  });
                   if( this.formData.jtzysr != ""){
                    this.formData.jtzysr =  this.formData.jtzysr.split("，");
                  }else{
                    this.formData.jtzysr = []
                  }
                  if(  this.formData.tfsj != ""){
                      this.formData.tfsj =  this.formData.tfsj.split("，");
                  }else{
                    this.formData.tfsj = []
                  }
                  return
                }
                if (!this.formData.bjpyyj) {
                  Message({
                    message: '请确认认定困难类型',
                    type: 'error'
                  });
                   if( this.formData.jtzysr != ""){
                      this.formData.jtzysr =  this.formData.jtzysr.split("，");
                    }else{
                      this.formData.jtzysr = []
                    }
                    if(  this.formData.tfsj != ""){
                        this.formData.tfsj =  this.formData.tfsj.split("，");
                    }else{
                      this.formData.tfsj = []
                    }
                  return
                }
                  this.user.signature = this.formData.fdyqm;
              
              }
              if (stu == 3) {
                if (!this.formData.ejxyldqm) {
                  Message({
                    message: '请上传签名图片',
                    type: 'error'
                  })
                  if( this.formData.jtzysr != ""){
                      this.formData.jtzysr =  this.formData.jtzysr.split("，");
                    }else{
                      this.formData.jtzysr = []
                    }
                    if(  this.formData.tfsj != ""){
                        this.formData.tfsj =  this.formData.tfsj.split("，");
                    }else{
                      this.formData.tfsj = []
                    }
                  return
                }
                if (!this.formData.ejxyldqmyj) {
                  Message({
                    message: '请确认认定困难类型',
                    type: 'error'
                  })
                  if( this.formData.jtzysr != ""){
                      this.formData.jtzysr =  this.formData.jtzysr.split("，");
                    }else{
                      this.formData.jtzysr = []
                    }
                    if(  this.formData.tfsj != ""){
                        this.formData.tfsj =  this.formData.tfsj.split("，");
                    }else{
                      this.formData.tfsj = []
                    }
                  return
                }
                 this.user.signature = this.formData.ejxyldqm;
               
              }
              if (stu == 4) {
                if (!this.formData.xsqm) {
                  Message({
                    message: '请上传签名图片',
                    type: 'error'
                  })
                  if( this.formData.jtzysr != ""){
                      this.formData.jtzysr =  this.formData.jtzysr.split("，");
                    }else{
                      this.formData.jtzysr = []
                    }
                    if(  this.formData.tfsj != ""){
                        this.formData.tfsj =  this.formData.tfsj.split("，");
                    }else{
                      this.formData.tfsj = []
                    }
                  return
                }
                if (!this.formData.xsqmyj) {
                  Message({
                    message: '请确认认定困难类型',
                    type: 'error'
                  })
                  if( this.formData.jtzysr != ""){
                      this.formData.jtzysr =  this.formData.jtzysr.split("，");
                    }else{
                      this.formData.jtzysr = []
                    }
                    if(  this.formData.tfsj != ""){
                        this.formData.tfsj =  this.formData.tfsj.split("，");
                    }else{
                      this.formData.tfsj = []
                    }
                  return
                }
                  this.user.signature = this.formData.xsqm;
               
              }
              // if(this.formData.xsqmyj=='4'){

              // }
              this.$refs['formData'].validate((valid) => { //编辑
                if (valid) {
                  this.formData.jtcy = JSON.stringify(this.formData.jtcyObj)
                  this.formData.step = stu + 1;
                  updateApply(this.formData).then(res => {
                    if (res.code == 200) {
                      this.$modal.msgSuccess("提交成功");
              
                        // if(this.data.length>1){
                        //   console.log(this.data.length)
                        //   console.log(this.indexs)
                        //   if(this.data.length-1==this.indexs){
                        //     this.$modal.msgSuccess("提交成功");
                        //     this.$tab.closePage();
                        //   }else{
                        //     this.$modal.msgSuccess("提交成功，下一个");
                        //     this.getApplyxq(this.data[this.indexs+1].id)
                        //     this.indexs=this.indexs+1
                        //     console.log(this.indexs)
                        //   }
                        // }else{
                        //   this.$modal.msgSuccess("提交成功");
                          this.doUpdateSignature();
                          //审核后解锁
                          unlock(this.formData);
                           this.next(stu);
                      // this.doUpdateSignature();
                      // this.$tab.closePage();
                      // }
                    }else{
                      this.$tab.closePage();
                    }
                  })
                } else {
                  return false
                }
              })
            }
          } else {
              
            if( this.formData.jtzysr != ""){
              this.formData.jtzysr =  this.formData.jtzysr.split("，");
            }else{
               this.formData.jtzysr = []
            }
            if(  this.formData.tfsj != ""){
                this.formData.tfsj =  this.formData.tfsj.split("，");
            }else{
               this.formData.tfsj = []
            }
            this.$confirm('还存在必填项未填，请仔细检查!', '提示', {
                  confirmButtonText: '确定',
                  cancelButtonText: '取消',
                  type: 'error'
                  })
  		    
            return false
          }
        })
      },

      handleAddRow() {
        if (this.formData.step != 1) {
          return
        }
        this.formData.jtcyObj.push({
          xm: "",
          nl: "",
          yxsgx: "",
          gzdw: "",
          zy: "",
          nsr: "",
          jkzk: "",
          gx: "",
          dw: ""
        })
      },
      handelIndex({
        row,
        rowIndex
      }) {
        row.index = rowIndex
        this.index = rowIndex
      },
      handelDel(row) {
        if (this.formData.step != 1) {
          return
        }
        if (this.formData.jtcyObj.length > 1) {
          this.formData.jtcyObj.splice(row.index, 1)
        } else {
          this.$message.error('至少保留一行')
        }
      },
      handleSignatureSuccess(response, file, fileList) {
        this.formData.sqrqm = response.fileName;
      },
      handleFdySignatureSuccess(response, file, fileLis) {
        this.formData.fdyqm = response.fileName;
      },
      handleEjxyldSignatureSuccess(response, file, fileLis) {
        this.formData.ejxyldqm = response.fileName;
      },
      handleXuexiaoSignatureSuccess(response, file, fileLis) {
        this.formData.xsqm = response.fileName;
      },
      //审核不通过
      no() {
        let step = this.formData.step;
        this.$prompt('请输入不通过原因', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',

        }).then(({
          value
        }) => {
          if (value != null && value != "") {
            // console.log()
            let params = {
              "remark": value,
              "step": this.formData.step,
              "applyId": this.formData.id,
              "status": "0",
            }
            nopass(params).then(response => {
              this.$modal.msgSuccess("操作成功");
              this.formData.step = this.formData.step + 1;
            });
          } else {
            this.$modal.msgError("请输入原因");
          }
        });
      },

      next(step){
            this.nextLoading = true;
              //获取
            let date = new Date();
            let month = date.getMonth() + 1
            if(step == 4){
                jwcNext().then(res=>{
                   this.nextLoading = false;
                  if(res.data){

                  
                    this.getRecordList(res.data.id)
                    this.getInfo(res.data.id, date, month);
                    this.$notify({
                        title: '提示信息',
                        message: '已加载下一个',
                        type: 'success',
                        position: 'bottom-right'
                        
                    });
                    this.scrollTop();
                    }else{
                    
                       this.$tab.closePage();
                    }
                });
            }else if(step == 2){
                fdyNext().then(res=>{
                   this.nextLoading = false;
                    if(res.data){
                      this.getRecordList(res.data.id)
                      this.getInfo(res.data.id, date, month);
                      this.$notify({
                        title: '提示信息',
                        message: '已加载下一个',
                        position: 'bottom-right',
                        type: 'success',
                      });
                      this.scrollTop();
                    }else{
             
                       this.$tab.closePage();
                    }
                });
            }else if(step == 3){
                  xwNext().then(res=>{
                   this.nextLoading = false;
                    if(res.data){
                      this.getRecordList(res.data.id)
                      this.getInfo(res.data.id, date, month);
                      this.$notify({
                        title: '提示信息',
                        message: '已加载下一个',
                        type: 'success',
                        position: 'bottom-right'
                      });
                      this.scrollTop();
                    }else{
                       
                       this.$tab.closePage();
                    }
                  });
            }
      },
      scrollTop(){
        document.querySelector("#table").scrollIntoView();
        
      }

    },
    computed: {
      income: function() {
        // return this.formData.jtcyObj.length
        let total = 0
        for (var i = 0; i < this.formData.jtcyObj.length; i++) {
          total += Number(this.formData.jtcyObj[i].nsr)
        }
        return this.formData.jtnsr = total.toFixed(2);
      },
      capita: function() {
        return this.formData.rjnsr = parseFloat(this.formData.jtnsr / this.formData.rkzs).toFixed(2)
      },
    }
  }
</script>

<style scoped>
  /* 强制打印背景颜色/图像 */
  * {
    -webkit-print-color-adjust: exact !important;
    /* Chrome, Safari */
    color-adjust: exact !important;
    /*Firefox*/
  }

  .rl {
    writing-mode: vertical-rl;
  }

  .form-blok {
    margin: 0 auto;
    width: 1000px;
    /* border: 1px solid #ebebeb; */
    border-radius: 3px;
    transition: .2s;
  }

  .source {
    text-align: center;
    display: flex;
    justify-content: center;
    flex-direction: column;

  }

  /* 表格样式 */
  .full-width {
    border-collapse: collapse;
    width: 100%;
  }

  .full-width2 {
    border-collapse: collapse;
    width: 100%;
  }

  td {
    padding: 8px 4px;
    min-width: 100px;
    /* max-width: 110px; */
    box-sizing: border-box;
    text-overflow: ellipsis;
    vertical-align: middle;
    position: relative;
    text-align: center;
    border: 1px solid #000;
  }

  .table-label {
    width: 126px;
    background: #ededed;

  }

  .table-input {
    min-width: 100px;
    padding: 8px 4px;
    word-wrap:break-word; 
word-break:break-all; 
overflow: hidden;

  }

  .table-align-left {
    padding: 8px 4px;
    text-align: left;
  }

  /* 学院专业班级信息 */
  .class-info {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;

  }

  .class-info>>>.el-input__inner {
    padding: 0px
      /* text-align: right; */
  }

  .class-info div {
    height: 25px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
  }

  .class-info div span {
    line-height: 25px;
  }

  /* 输入样式统一 */
  /deep/ .el-input__inner {
    border-width: 0px;
    padding: 0px;
    text-align: center
  }

  /* 表单样式统一 */
  /deep/ .el-form-item {
    margin-bottom: 0;
  }

  /deep/ .el-textarea__inner {
    border-width: 0px;
  }

  /deep/ .el-date-editor {
    width: 140px;
  }

  /deep/ .el-form-item__error {
    padding-left: 4px;
    position: relative;
    text-align: left;

  }

  .radio-group /deep/ .el-radio-group {
    width: 180px;

  }

  /*  */
  .radio-group-row {
    display: flex;
    flex-direction: row;
    justify-content: left;
    align-content: center;
    font-size: 14px;
    line-height: 20px;

  }

  .signature {
    display: flex;
    flex-direction: row;
    justify-content: right;
    align-content: center;
    margin-right: 20px;
    flex-wrap: wrap;
  }

  .signature span {
    display: block;
    min-width: 50px;
    /* height: 36px;
        line-height: 36px; */
  }

  .signature>div {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
  }

  .avatar {
    width: 117px;
    height: 156px;
  }

  /deep/ .el-upload {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  .image-input {
    padding: 0;
    width: 120px;
    height: 160px;
  }

  .signature-img {
    width: 160px;
    height: 50px;
  }

  .signature-tip {
    width: 160px;
    cursor: pointer;
    color: #1890ff;
    text-align: left;

  }


  .qm {
    display: flex;
    flex-direction: column;
    align-content: center;

  }

  .qm>span {

    text-align: left;
    padding-left: 12px;
  }

  .qm>div {

    text-align: right;
    padding-right: 12px;
  }

  .qm>.avatar-uploader {
    padding: 12px 0px;
    text-align: center;
  }

  /deep/ .el-input.is-disabled .el-input__inner {
    background-color: #fff;
    color: #000;
    padding: 0;
    align-items: center;
  }

  /deep/ .el-radio.is-disabled .is-checked .el-radio__inner {
    background-color: #67c23a;
  }


  .list .item {
    display: flex;
    flex-direction: row;
    justify-content: left;
  }

  .list .item span {
    padding: 10px;
  }

  .cm-affix {
    display: flex;
    flex-direction: row;
    justify-content: left;
    align-items: center;
  }

  .record ul {
    padding-inline-start: 0px !important;
  }

  .record .title {
    padding: 20px 0px;
  }
  .red-tip{
    display: inline-block;
    font-size: 14px;
    padding: 0px 5px;
    height: 17px;
    line-height: 17px;
    color: red;
  }
  

  .newSign{
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
  }
  #print{
	font-size: 14px;
  margin: 0 auto;
  }
  .el-checkbox-group {
	text-align: left;
  }
  .dialog-footer{
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-content: center;
  }
      .reject /deep/ .el-input__inner{
        border-width: 1px;
        padding-left: 15px;
        text-align: left;
        
    }
    .reject   /deep/ .el-textarea__inner{
        border-width: 1px;
    }
    #print{
        text-align: left;
		    padding: 30px  60px  0px 60px ;
     }
    #print th{
        padding: 2px;
    }
    #print td{

        padding: 2px;
    }
  #print >>> td{
      padding: 2px;
  }
  #print h1{
      text-align: center;
  }
  @media print {
    @page {
      margin: 20mm; /* 设置页边距为20毫米 */
    }
  }
  /*去除页眉页脚*/
  @page{
    size:  auto;   /* auto is the initial value */
    margin: 3mm;  /* this affects the margin in the printer settings */
  }

  html{
    background-color: #FFFFFF;
    margin: 0;  /* this affects the margin on the html before sending to printer */
  }

  body{
    border: solid 1px blue ;
    margin: 20mm 20mm 20mm 20mm; /* margin you want for the content */
  }

  #print .table-input, 
  #print .table-label{
    padding: 15px 10px ;
  }
  #print /deep/ .el-table--border .el-table__cell {
    border-right: 1px solid #000!important;
    }
  #print /deep/ .el-table th.el-table__cell.is-leaf{
      border-bottom: 1px solid #000!important;
  }
  #print /deep/ .el-table td.el-table__cell{
      border-bottom: 1px solid #000!important;
  }
  .split{
    height: 50px;
    color: #fff;
    border: 0px solid #000!important;
  }
</style>
